package org.lucava.boatskeeper.client.event.boat;

import org.lucava.boatskeeper.shared.Boat;

import com.google.gwt.event.shared.GwtEvent;

public class BoatUpdatedEvent extends GwtEvent<BoatUpdatedEventHandler> {
	public static Type<BoatUpdatedEventHandler> TYPE = new Type<BoatUpdatedEventHandler>();
	private final Boat updatedBoat;

	public BoatUpdatedEvent(Boat updatedBoat) {
		this.updatedBoat = updatedBoat;
	}

	public Boat getUpdatedBoat() {
		return updatedBoat;
	}

	@Override
	public Type<BoatUpdatedEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(BoatUpdatedEventHandler handler) {
		handler.onBoatUpdated(this);
	}
}
